/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.apt.religion_tag.process;

import com.apt.tag.Connect_DB;
import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 *
 * @author Bach
 */
public class EnableReligion {
 public static boolean setEnableReligion(String namepayment) {

        String up = " UPDATE [Matrimony].[dbo].[Religion_Types] SET [Religion_Type_Status] = 1 WHERE [Religion_Type_Name]=?";
        boolean re = false;
        Connection con = null;
        PreparedStatement ps = null;
        try {
            con = Connect_DB.getConnection();
            ps = con.prepareStatement(up);
            ps.setString(1, namepayment);
            int i = ps.executeUpdate();
            if (i > 0) {
                re = true;
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            Connect_DB.close(null, null, ps, con);
        }
        return re;
    }
}
